Field of the Invention
The present disclosure relates to a distance measurement apparatus for measuring the three-dimensional distance of a measurement target object in a non-contact manner.
Description of the Related Art
Conventionally, various techniques are discussed as a distance measurement method. The distance measurement method is broadly classified into a passive distance measurement method for measuring a distance using only an imaging apparatus without using an illumination apparatus, and an active distance measurement method for measuring a distance using an illumination apparatus and an imaging apparatus in combination. In the active distance measurement method, the illumination apparatus projects pattern light onto a measurement target object, and the imaging apparatus captures an image. Therefore, even if the amount of surface texture of the measurement target object is small, it is possible to measure a distance using the pattern light as a clue. As the active distance measurement method, various techniques, such as a spatial coding method, a phase shift method, a grid pattern projection method, and a light-section method are discussed. These techniques are based on a triangulation method and therefore measure a distance based on the direction of emission of pattern light from a projection apparatus.
If the measurement target object is directed in various directions, or if the measurement target object includes members having various reflectances, a region where the image luminance is high and a region where the image luminance is low coexist in the captured image. In the region where the image luminance is high, the contrast of the pattern light is high, and the noise component is small. Thus, it is possible to measure a distance in a favorable manner. On the other hand, in the region where the image luminance is low, the contrast of the pattern light is low, and the noise component is relatively large. If the noise component is large, the measurement accuracy decreases. Further, in the spatial coding method, decoding is failed, and the direction of emission from the projection apparatus is erroneously determined. This causes a large measurement error. To reduce a measurement error, it is necessary to reduce noise. One of such noise reduction methods is a spatial smoothing process.
Japanese Patent Application Laid-Open No. 2004-191198 discusses a method for performing edge detection in an image of a target object onto which measurement pattern light is projected, and changing the size of a noise reduction filter based on the number of the detected edges.
If the method of Japanese Patent Application Laid-Open No. 2004-191198 is used, it is desirable to detect only edges in a boundary portion of the pattern light and count the number of the detected edges. However, an edge is detected in a portion other than the boundary portion of the pattern light in the following cases. First, a measurement scene includes the boundary between surfaces, the directions of the surfaces are different, and therefore, the amounts of reflected light are different. Second, the target object has texture, and therefore, the amount-of-reflected-light distribution of a surface is locally different. Thus, it is not possible to appropriately count the number of edges. Further, in such cases, it is difficult to determine an appropriate filter size.
According to the present application, even in a case where the amount-of-reflected-light distribution of a surface is locally different, an appropriate filter is applied to an image, whereby it is possible to measure a distance with higher accuracy.